/**  
 * All rights Reserved, Designed By www.woniuxy.com
 * @Title:  Account.java   
 * @Package com.woniu.domain   
 * @Description:    Description  
 * @author: 蜗牛学院  
 * @date:   2019年8月22日 下午8:13:08
 * @user:   Administrator  
 * @version V1.0 
 * @Copyright: 2019 www.woniuxy.com Inc. All rights reserved. 
 * 注意：本内容仅限于成都蜗牛创想科技有限公司，禁止外泄以及用于其他的商业目
 */ 
package com.woniu.utils;

import java.util.List;

/**
 * @author Administrator
 *
 */
public class PageBean {
	//首页 上一页 下一页 尾页
	private int pageNow;//当前页
	private int lastPage;//上一页
	private int nextPage;//下一页
	private int pageSize;//每页显示的条数
	private int startRow;//从第几条开始显示
	private int rowCount;//总条数
	private int pageCount;//总页数
	private List<?> lists;
	
	public PageBean(int pageNow, int rowCount, List<?> lists) {
		super();
		this.pageNow = pageNow;
		this.rowCount = rowCount;
		this.lists = lists;
		if(rowCount % this.getPageSize() == 0) {
			this.pageCount = rowCount/this.getPageSize();
		}else if(rowCount % pageSize != 0) {
			this.pageCount = rowCount/this.getPageSize()+1;
		}
	}
	
	
	public PageBean(int rowCount, List<?> lists) {
		super();
		this.rowCount = rowCount;
		this.lists = lists;
		if(rowCount % this.getPageSize() == 0) {
			this.pageCount = rowCount/this.getPageSize();
		}else if(rowCount % pageSize != 0) {
			this.pageCount = rowCount/this.getPageSize()+1;
		}
	}


	public PageBean() {
		super();
		// TODO Auto-generated constructor stub
	}

	/**
	 * @return the pageNow
	 */
	public int getPageNow() {
		if(this.pageNow==0) {
			this.pageNow = 1;
		}
		return pageNow;
	}
	/**
	 * @param pageNow the pageNow to set
	 */
	public void setPageNow(int pageNow) {
		
			this.pageNow = pageNow;
		
		
	}
	/**
	 * @return the lastPage
	 */
	public int getLastPage() {
		this.lastPage = this.getPageNow() - 1;
		return lastPage;
	}
	/**
	 * @param lastPage the lastPage to set
	 */
	public void setLastPage(int lastPage) {
		
		this.lastPage = lastPage;
	}
	/**
	 * @return the nextPage
	 */
	public int getNextPage() {
		this.nextPage = this.getPageNow() + 1;
		return nextPage;
	}
	/**
	 * @param nextPage the nextPage to set
	 */
	public void setNextPage(int nextPage) {
		this.nextPage = nextPage;
	}
	/**
	 * @return the pageSize
	 */
	public int getPageSize() {
		this.pageSize=3;
		return pageSize;
	}
	/**
	 * @param pageSize the pageSize to set
	 */
	public void setPageSize(int pageSize) {
		
		this.pageSize = pageSize;
		
	}
	/**
	 * @return the startRow
	 */
	public int getStartRow() {
		this.startRow = (this.getPageNow()-1)*this.getPageSize();
		return startRow;
	}
	/**
	 * @param startRow the startRow to set
	 */
	public void setStartRow(int startRow) {
		this.startRow = startRow;
	}
	/**
	 * @return the rowCount
	 */
	public int getRowCount() {
		return rowCount;
	}
	/**
	 * @param rowCount the rowCount to set
	 */
	public void setRowCount(int rowCount) {
		this.rowCount = rowCount;
	}
	/**
	 * @return the pageCount
	 */
	public int getPageCount() {
		return pageCount;
	}
	/**
	 * @param pageCount the pageCount to set
	 */
	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}
	/**
	 * @return the lists
	 */
	public List<?> getLists() {
		return lists;
	}
	/**
	 * @param lists the lists to set
	 */
	public void setLists(List<?> lists) {
		this.lists = lists;
	}
	
}
